<template>
	<view class="">
		<view class="photo">
			<!-- 没有相册的时候 -->
			<view class="ph" v-if="pictuer.length >= 1">
				<view class="pictuer" v-for="(item, index) in pictuer" :key="index" @click="todetail(item.id)">
					<image :src="item.cover" mode="aspectFill"></image>
					<view class="pictuer_bot">
						<view class="title">{{ item.name }}</view>
						<view class="num">{{ item.pic_num }}张</view>
					</view>
				</view>
			</view>
			<view class="nophoto" v-else>
				<view class="load" v-if="loadflag">页面加载中</view>
				<view class="" v-else>
					<image src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/index/nodata.png" mode=""></image>
					<span>暂无相册</span>
				</view>
			</view>
		</view>
		<navigation></navigation>
	</view>
</template>

<script>
import buTton from '../../components/mine/button.vue';
import navigation from '@/components/navigation/navigation.vue';
export default {
	components: { buTton, navigation },
	props: ['photoid'],
	data() {
		return {
			flag: true,
			pictuer: [],
			loadflag: true
		};
	},
	mounted() {
		this.getphoto();
	},
	methods: {
		getphoto() {
			this.ajax('active/activeAlbumInfo', {
				data: { active_id: this.photoid },
				success: res => {
					 // console.log (res);
					this.pictuer = res.msg;
					this.loadflag = false;
				}
			});
		},
		todetail(key) {
			this.$emit('tophotodetail', key);
		}
	}
};
</script>

<style lang="less" scoped>
@import url('../../static/less/pageA/competiondetail/photo.less');
</style>
